package com.uyaer.card.common
{
	import flash.net.SharedObject;

	public class Config
	{
		public static var platform:String = "web";
		
		/**
		 *图片素材地址 
		 */		
		public static var textureSource:String = "assets/texture/";
		public static var audioSource:String = "assets/audio/";
		
		/**
		 *素材标准宽带(素材按照这个标准制作的) 
		 */		
		public static var BASIC_W:int = 640;
		
		public static var debug:Boolean = false;
		private static var _MUSIC:Boolean = true;
		
		
		/**
		 *从文件中读取配置 
		 * 
		 */		
		public static function read():void{
			var shared:SharedObject = SharedObject.getLocal("config");
			var data:Object = shared.data.config;
			if(data){
				_MUSIC = data.music;
			}else{
				_MUSIC = true;
			}
		}
		
		/**
		 *保存配置
		 * 
		 */		
		public static function save():void{
			var data:Object = new Object();
			data.music = _MUSIC;
			var shared:SharedObject = SharedObject.getLocal("config");
			shared.data.config = data;
		}

		/**
		 * 是否播放音乐
		 */
		public static function get MUSIC():Boolean{
			return _MUSIC;
		}

		/**
		 * @private
		 */
		public static function set MUSIC(value:Boolean):void{
			_MUSIC = value;
			save();
		}

	}
}